package com.atguigu.springboot.controller;

import com.atguigu.springboot.entity.Employee;
import com.atguigu.springboot.mapper.EmployeeMapper;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @author : wenchao.long
 * @date : Created in 2020/11/25 16:05 周三
 * @description :
 */
@RestController()
@RequestMapping("/employee")
@AllArgsConstructor
public class EmployeeController {
    private final EmployeeMapper employeeMapper;

    @GetMapping()
    public Employee getById(@RequestParam("id") Integer id) {
        return employeeMapper.getById(id);
    }

    @PutMapping()
    public void insert(@RequestBody Employee employee) {
        employeeMapper.insert(employee);
    }
}
